% Test logit model

addpath ../

nind = 500;
npheno = 5;

X = randn(nind,10,'single');
effect_true = (-1).^(rand(npheno,3,'single') < .5);
noise = randn(nind,npheno,'single')*0.1;

Y = single(rand(nind,npheno,'single') < 1./(1+exp(-X(:,1:3) * effect_true' + noise)));

[effect, effect_var, invTauSq, llik] = update_logit_model(Y, X, 10, 1000);

bar(-log10(normcdf( abs(effect ./ sqrt(effect_var))', 'upper' )));
